<?php
/*   Description  of this file
 *    Author king-of-war
 *    Last Modified 2009-5-6
 *    This class designed  for the table operation
 */
 @session_start();
  echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">';

 $root_path='../';
 include_once $root_path.'admin/smarty_config.php';
include_once $root_path.'admin/class/db.class.php';
include_once $root_path.'admin/class/verify.class.php';
$db=new db($root_path);
/*
 * check the right
 */
$check=new verify($root_path);
$check->identity_check(3);


/*
 * accept &&  delete
 */
if(isset($_POST['Submit'])){
	$tables=array();
	if(isset($_POST['vote']))
	$tables[0]='vote';
		if(isset($_POST['vote_se']))
	$tables[1]='vote_se';
		if(isset($_POST['votes']))
	$tables[2]='votes';
		if(isset($_POST['products_sort']))
	$tables[3]='products_sort';
		if(isset($_POST['products']))
	$tables[4]='products';
		if(isset($_POST['flinks']))
	$tables[5]='flinks';
		if(isset($_POST['news']))
	$tables[6]='news';
			if(isset($_POST['count']))
	$tables[7]='count';
			if(isset($_POST['guest_book']))
	$tables[8]='guest_book';

	sort($tables);
	if(count($tables)>0){
$line=$db->db_trun($tables);
if($line){
	echo '成功清空'.$line.'个表';
}else{
	echo '清空失败';
}
	}else{
		echo '请先选择要处理的数据';
	}
}

/*
 * set the template for data_back.php
 */


$smarty->display("data_back.html");


?>